<?php
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class AddColumnReviewRequestNodeIdAndCheckListIdInNoteTable extends AbstractMigration
{
    public function up()
    {
        $this->table('note')
            ->addColumn('is_feedback_show', 'enum', ['values' => 'yes,no', 'default' => 'no', 'comment' => '是否展示'])
            ->addColumn('review_request_node_id', 'integer', ['signed' => false, 'limit' => 11, 'default' => 0, 'comment' => '审核节点id'])
            ->addColumn('check_list_id', 'integer', ['signed' => false, 'limit' => 11, 'default' => 0, 'comment' => '关联审核列表ID'])
            ->save();
    }

    public function down()
    {
        $this->table('note')
            ->removeColumn('review_request_node_id')
            ->removeColumn('check_list_id')
            ->removeColumn('is_feedback_show')
            ->save();
    }
}
